Skip to content

List instances and List revision should use ST Id not name#9643

Open
Avisiktapatra wants to merge 42 commits intoAzure:mainfrom
manaswita-chichili:avpatra/RevisionInstancesFix
Open

List instances and List revision should use ST Id not name#9643
Avisiktapatra wants to merge 42 commits intoAzure:mainfrom
manaswita-chichili:avpatra/RevisionInstancesFix

Conversation

@Avisiktapatra
Copy link

@Avisiktapatra Avisiktapatra commented Mar 2, 2026


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings March 2, 2026 04:52
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Mar 2, 2026

❌Azure CLI Extensions Breaking Change Test
❌nginx
rule cmd_name rule_message suggest_message
1002 - CmdRemove nginx deployment waf-policy analyze-waf-policy cmd nginx deployment waf-policy analyze-waf-policy removed please confirm cmd nginx deployment waf-policy analyze-waf-policy removed
❌workload-orchestration
rule cmd_name rule_message suggest_message
1010 - ParaPropUpdate workload-orchestration target solution-instance-list cmd workload-orchestration target solution-instance-list update parameter solution_name: updated property options from ['--solution', '--solution-template-name'] to ['--solution-id', '--solution-template-id'] please change property options from ['--solution-id', '--solution-template-id'] to ['--solution', '--solution-template-name'] for parameter solution_name of cmd workload-orchestration target solution-instance-list
1010 - ParaPropUpdate workload-orchestration target solution-revision-list cmd workload-orchestration target solution-revision-list update parameter solution_name: updated property options from ['--solution', '--solution-template-name'] to ['--solution-id', '--solution-template-id'] please change property options from ['--solution-id', '--solution-template-id'] to ['--solution', '--solution-template-name'] for parameter solution_name of cmd workload-orchestration target solution-revision-list
⚠️ 1001 - CmdAdd workload-orchestration solution-template update-capabilities cmd workload-orchestration solution-template update-capabilities added
⚠️ 1011 - SubgroupAdd workload-orchestration support sub group workload-orchestration support added

@azure-client-tools-bot-prd
Copy link

Hi @Avisiktapatra,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 2, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

Hi @Avisiktapatra

⚠️ Release Requirements

Module: workload-orchestration

  • ⚠️ Please update VERSION to be 6.0.0 in src/workload-orchestration/setup.py

Notes

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates workload-orchestration target listing commands to use the solution template’s uniqueIdentifier (ST Id) instead of the template name when calling the target “solutions” list endpoints, to align with the service’s expected identifier.

Changes:

  • Add a shared TargetHelper.get_solution_template_unique_identifier(...) to fetch a solution template and extract properties.uniqueIdentifier.
  • Update target solution-instance-list to resolve and use uniqueIdentifier for the solutionName path segment.
  • Update target solution-revision-list to resolve and use uniqueIdentifier for the solutionName path segment.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_target_helper.py New helper for resolving solution template uniqueIdentifier via a GET on solutionTemplates.
src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_solution_instance_list.py Uses resolved uniqueIdentifier in URL params for listing solution instances.
src/workload-orchestration/azext_workload_orchestration/aaz/latest/workload_orchestration/target/_solution_revision_list.py Uses resolved uniqueIdentifier in URL params for listing solution revisions.

Comment on lines 92 to 101
def __call__(self, *args, **kwargs):
# Resolve solution template name to its uniqueIdentifier
self.unique_identifier = TargetHelper.get_solution_template_unique_identifier(
self.ctx.subscription_id,
self.ctx.args.resource_group,
self.ctx.args.solution_name,
self.client
)

request = self.make_request()
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new behavior adds an extra management-plane GET to resolve the solution template uniqueIdentifier before listing instances, but there’s no scenario coverage for this command path in the extension tests. Adding/adjusting a scenario test to exercise workload-orchestration target solution-instance-list (including the extra solutionTemplates GET) would help prevent regressions.

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Mar 2, 2026
@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Mar 2, 2026
Avisiktapatra and others added 2 commits March 2, 2026 10:45
…test/workload_orchestration/target/_target_helper.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…test/workload_orchestration/target/_target_helper.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@yonzhan yonzhan requested a review from necusjz March 2, 2026 06:42
Atharva and others added 5 commits March 11, 2026 10:34
Adds a new CLI command for collecting diagnostic data from K8s clusters
running the WO extension. Produces a zip bundle with:
- 18 prerequisite health checks (K8s version, nodes, DNS, storage,
  cert-manager, webhooks, PSA, quotas, CSI, proxy, RBAC)
- Container logs (tailed, parallel collection, + previous logs)
- Resource descriptions (pods, deployments, services, events, etc.)
- WO component status (Symphony, ClusterIssuers, Gatekeeper)
- Node/pod metrics (kubectl top equivalent)

All operations are read-only. Bundle is always generated even if
individual collection steps fail. 136 unit + integration tests.

Tested on AKS (BVT-Test-Cluster) and minikube (vanilla cluster).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add container state details (exit codes, restart reasons, last terminated)
- Add node taints and detailed conditions (reason + message)
- Add StatefulSet collection to namespace resources
- Improve RBAC 403 errors with remediation guidance
- Improve 401 errors with credential refresh guidance
- Add disk space pre-flight check before collection
- Better capability detection fallback (returns all-false, not empty dict)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rce collectors, health summary

- Add retry with exponential backoff (3 retries, 1/2/4s) to safe_api_call
- Add per-API-call timeout (30s default) via _request_timeout injection
- Add thread-level timeout for container log collection (60s default)
- Add pre-flight namespace existence validation (skip non-existent/terminating)
- Add ReplicaSet, Job, CronJob, Ingress, NetworkPolicy, ServiceAccount collectors
- Add _get_owner_ref helper for ReplicaSet owner tracking
- Add overall health summary (HEALTHY/DEGRADED/CRITICAL/UNKNOWN) to metadata
- Add health score computation (0-100) based on check results
- Show health status in final output summary
- Add 34 new unit tests (170 total, all passing)
- Add root-level conftest.py for pytest mock setup

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add support bundle feature description to HISTORY.rst v5.0.0
- Simplify inner tests/conftest.py to only handle sys.path setup
- Root conftest.py handles all azure.cli mock module setup

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move support bundle modules into azext_workload_orchestration/support/ package:
  _support_consts.py    → support/consts.py
  _support_utils.py     → support/utils.py
  _support_collectors.py → support/collectors.py
  _support_validators.py → support/validators.py
  (new) bundle.py       — orchestration logic extracted from custom.py
  (new) __init__.py     — public API: create_support_bundle()
  (new) README.md       — architecture docs, how to add checks/collectors

custom.py now re-exports create_support_bundle from the support package.

Adding a new check = write one function + add one line to the checks list.
Adding a new collector = add one code block to collect_namespace_resources().

All 170 tests pass. E2E verified on live AKS cluster (18/18 checks PASS).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Atharva and others added 5 commits March 12, 2026 15:31
…r-wide events

- Add _check_arc_dependencies: validates azure-arc and azure-extensions
  namespaces exist with healthy pods (prerequisite for WO extension)
- Add _check_wo_services_deployments: verifies WO deployments have all
  replicas ready and services are present
- Add collect_all_events: collects events from ALL namespaces into
  cluster-info/events.json (warnings prioritized, capped at 500)
- Total checks: 20 (was 18)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@manaswita-chichili
Copy link
Contributor

Tested the resource Id validation changes:
image
image
image
image

@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Mar 16, 2026
@Avisiktapatra
Copy link
Author

Validation: Solution revision list
image

Validation: solution instance list
image

@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Mar 16, 2026
@necusjz
Copy link
Member

necusjz commented Mar 16, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Avisiktapatra
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

@necusjz
Copy link
Member

necusjz commented Mar 17, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Mar 17, 2026
@necusjz
Copy link
Member

necusjz commented Mar 18, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Atharva and others added 4 commits March 18, 2026 11:12
Merge audapure/wo-support-bundle into avpatra/RevisionInstancesFix.
Adds az workload-orchestration support create-bundle command.
Version kept at 5.1.1, support bundle entry added to HISTORY.rst.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix unused imports (STATUS_*, FOLDER_LOGS, format_bytes, SC_DEFAULT_*)
- Fix unused variables (err -> _err, log_err -> _log_err, contexts, total, used)
- Fix broad-exception-caught with inline pylint disable
- Fix too-many-return-statements with inline pylint disable
- Fix line-too-long in collectors.py and bundle.py
- Fix unused-import in custom.py with pylint disable comment
- Refactor parse_memory_gi to use dict-based suffix lookup
- Refactor check_disk_space to use named tuple access

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove unused imports (DEFAULT_TIMEOUT_SECONDS, FOLDER_CHECKS, DNS_INTERNAL_HOST)
- Fix unused variables with underscore prefix (_ctx_name, _status, _err)
- Fix E127 continuation line indentation in bundle.py, collectors.py
- Fix line-too-long violations in validators.py
- Fix E226 missing whitespace around arithmetic operator
- Add pylint disable for unused-argument in validators (standard signatures)
- Add pylint disable for broad-exception-caught in diagnostic code
- Extract _append_namespace_resources and _append_wo_components helpers
  to fix too-many-branches and too-many-nested-blocks in bundle.py
- Remove duplicate json import (W0404)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add comprehensive pylint disables for utils.py (broad-exception, too-many-args)
- Add comprehensive pylint disables for bundle.py (all structural warnings)
- Add too-many-locals disable for validators.py
- Add too-many-lines,branches,statements,locals,args disables for collectors.py
- Fix _contexts unused variable in utils.py
- Fix disk_usage to use named tuple access
- All previous fixes were uncommitted - pushing now

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@necusjz
Copy link
Member

necusjz commented Mar 18, 2026

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants